<%@ page language="java" contentType="text/html" session="true"%>
<%@ page import="camel.client.CamelRemote"%>
<%@ page import="java.util.Properties"%>
<%@ page import="java.util.List"%>
<%@ page import="javax.naming.InitialContext" %>
<%@ page import="camel.client.ParticipantLoginInfo" %>
<%@ page import="camel.client.SessionTicket"%>
<%@ page import="camel.client.TeamMemberStatus"%>
<%@ page import="camel.client.BriefSessionInfo" %>

<html>
<title>Session list</title>
<body>
<font>Session List</font>
<TABLE Border="2" WIDTH="100%" BGCOLOR="#DDDDFF">
<tr BGCOLOR="#ffffee">
    <td><%= "ID"%></td>
    <td ><%="Description"%></td>
    <td><%= "Time Created"%></td>
    <td><%= "Title"%></td>  
    <td><%= "Creator"%></td>  
</tr>
<br>
<%  
		int i =0;
		try {
		
			
			CamelRemote  remote = (CamelRemote)session.getAttribute("remote");
			SessionTicket ticket = (SessionTicket)session.getAttribute("ticket");
			
	       
			List<BriefSessionInfo> list = remote.getSessionList(ticket);		
			for (BriefSessionInfo bf: list) {
				 i++;
%>
			<tr>
			    <td><%=bf.getSessionId() %></td>
    			<td><%=bf.getDescription()%></td>
    			<td><%=bf.getTimeCreated()%></td>
    			<td><%=bf.getTitle()%></td>
    			<td><%=bf.getCreator()%></td>
			</tr>
<%
			}
		

    	} catch (Exception e) {
	    e.printStackTrace();	    	
    }
%>
</TABLE>
<TABLE Border="2" WIDTH="300" BGCOLOR="#ffffee">
<tr><td>count</td><td><%=i%></td></tr>
</TABLE>
</body>
</html>